package unidad6;

public class StringDemo {

	
	
	public static void main (String [] args){
	
		String s1 = new String("Jones");
		String s2 = new String("James");
		String s3 = s1;
		String s4 = s3;
		String s5 = "Tom";
		String s6 = "Jones";
		String s7 = new String("James");
		String s8 = "Tom";
		String s9 = new String("jones");
		
		
		System.out.println((s1.equals(s2)?true:false)+" "+s1+" equals "+s2);
		System.out.println((s4.equals(s1)?true:false)+" "+s4+" equals "+s1);
		System.out.println((s2.equals(s7)?true:false)+" "+s2+" equals "+s7);
		System.out.println((s1.equals(s6)?true:false)+" "+s1+" equals "+s6);
		System.out.println((s4 == s1?true:false)+" "+s4+" == "+s1);
		System.out.println((s2 == s7?true:false)+" "+s2+" == "+s7);
		System.out.println((s8 == s5?true:false)+" "+s8+" == "+s5);
		System.out.println((s1.equalsIgnoreCase(s9)?true:false)+" "+s1+" equalsIgnoreCase "+s9);
		System.out.println((s1.compareTo(s9))+" "+s1+" compareTo "+s9);
		System.out.println(s6+" length "+s6.length());
		System.out.println(s5+" charAt(2) "+s5.charAt(2));
		System.out.println(s7+" substring(3) "+s7.substring(3));
		
		
		
		
	}
}
